package x.ovo.wechat.bot.common.event;

import lombok.Setter;
import x.ovo.wechat.bot.common.Context;
import x.ovo.wechat.bot.common.plugin.Plugin;

/**
 * 事件侦听器
 *
 * @author ovo, created by 2024/05/01
 */
@Setter
public abstract class EventListener<T extends Event<?>> implements java.util.EventListener {

    protected Context context;
    protected Plugin plugin;

    /**
     * 支持此事件
     *
     * @param event 事件
     * @return boolean
     */
    public abstract boolean support(Event<?> event);

    /**
     * 事件回调
     *
     * @param event 事件
     */
    public abstract void onEvent(T event);
}
